<?php
/**
 * Created by 784855684@qq.com.
 * Link: https://github.com/lichtung/wshore
 * User: linzh
 * Date: 6/25/17
 * Time: 7:08 PM
 */
declare(strict_types=1);


namespace application\module\controller;

use wshore\core\Dao;
use wshore\core\Response;
use wshore\core\view\Render;

class index
{
    use Render;

    public function jsonp()
    {
        echo "hello";
    }

    public function appdemo()
    {
        echo <<<endline
        <button id="clickclose">clickclose</button>
<script>
    document.getElementById("clickclose").onclick = function () { 
         window.parent.document.getElementById("myframe").style.display="none";
     }
</script>
endline;


    }


    public function ajax()
    {
        header('Access-Control-Allow-Origin:*');
        Response::export($_GET, Response::TYPE_JSON);
    }

    public function index()
    {
        header('Access-Control-Allow-Origin:*');

        Response::export($_REQUEST, Response::TYPE_JSON);
//        Response::success('hello world', $_REQUEST);
    }

    public function testdb()
    {
        $dao = Dao::getInstance();
        dumpout($dao->getAdapter());
    }

}